package com.yidu.DailyFinalTreatment.mapper;

import com.yidu.DailyFinalTreatment.entity.CashInventMo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface CashInventMoMapper {
    @Select("SELECT c.bankName,c.accounName,a.balance,c.cashType,c.accounRate,c.openDate,a.cashInventorysTime,c.day,a.fundId,a.cashId,ROUND((a.balance*c.accounRate/100/ (CASE WHEN c.day=1 THEN 360 ELSE 365 END)),2) AS interest FROM (SELECT * FROM cashInventorys where ${date}) a JOIN (SELECT * FROM cash)c ON a.cashId=c.cashId")
    public List<CashInventMo> selectCashinvent(Map map);
}
